var userData = _appConfigs.getUserData().userOrgs;
var streetName = userData.orgName;
var streetId = userData.orgId;
$('#unemployedStreetGrid').datagrid({
    url:'collect/management/getUnemployedStreetList',  
    queryParams:{
    	streetName:userData.orgName,
		streetId:userData.orgId
    },
	rownumbers:true,
    fit:true,
    fitColumns:true,
    singleSelect:true,
//  nowrap:false,
    striped:true,

    columns:[[
              {field:'communityName',title:'社区名称',width:100,rowspan:3,align:'center'},
              {field:'project',title:'项目',width:100,rowspan:3,align:'center'},
              {title:'当年有就业愿望的登记失业人员',colspan:7,align:'center'}, 
              {field:'yearRealize',title:'当年实现就业<br />人数',width:100,rowspan:3,align:'center'},    
              {field:'employmentRate',title:'就业率',width:100,rowspan:3,align:'center'}] ,
              [
              {field:'unemployed',title:'小计',width:100,rowspan:2,align:'center'},
              {field:'priorYear',title:'上年结转',width:100,rowspan:2,align:'center'},    
              {title:'本年增加',colspan:2,align:'center'},
              {title:'个人原因减少',colspan:3,align:'center'}],
              [  
              {field:'totalYear',title:'小计',width:100,align:'center'},    
              {field:'totalMonth',title:'本月新增',width:100,align:'center'},
              {field:'reduceSummary',title:'小计',width:100,align:'center'},    
              {field:'objReason',title:'因客观原因',width:100,align:'center'},
              {field:'giveupJob',title:'放弃求职',width:100,align:'center'}
            ]]
	
}); 

function joblessCommunity(){
	var rowData = $('#unemployedStreetGrid').datagrid('getSelected');
	if(rowData == undefined){
		$.messager.alert('消息','请选择社区');
	}else{
		var isExists = window.mainpage.mainTabs.isExists('失业人员情况汇总表（社区）', 'collect/management/unemployedCollect_community_jump');
	    switch (isExists) {
	        case 0: 
	        	window.mainpage.mainTabs.createTab('失业人员情况汇总表（社区）','collect/management/unemployedCollect_community_jump',
	        		'', true, true, true, true, {name: 'bindData', params: rowData}); break;
	        case 1: 
	    	    window.mainpage.mainTabs.createTab('失业人员情况汇总表（社区）','collect/management/unemployedCollect_community_jump',
	    	    	'', true, true, true, true, {name: 'bindData', params: rowData}); break;
	        case 2: 
	    	    window.mainpage.mainTabs.jumpTab('失业人员情况汇总表（社区）', {name: 'bindData', params: rowData}); break;
	        default: break;
	    }
	}
}
/**
 * 失业人员街道汇总信息excel导出
 */
function exportUnemployedStreetList(){
	 debugger;
	 var street,community;
	 if(userData.porgId == _appConfigs.appOrgId){  //街道
		 street = userData.orgId;
		 community = "";
	 }else if(userData.porgId != _appConfigs.appOrgId && userData.orgName.indexOf('社区')>=0){ //社区
		 street = "";
		 community = userData.orgId;
	 }else{  //全部
		 street = "";
		 community = "";
	 }
	 window.location.href ="collect/excel/exportUnemployedStreetList?streetName=" + "" + "&streetId=" + street;
}

